package org.top10.entity;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;



@Entity
public class TOP10User {
	
	private int id;
	private String userName;
	private String email;
	private int headCronID;
	private Set<Comments> comment;
	private String ipAddr;
	
	public String getIpAddr() {
		return ipAddr;
	}
	public void setIpAddr(String ipAddr) {
		this.ipAddr = ipAddr;
	}
	@OneToMany(mappedBy="user",fetch=FetchType.LAZY)
	public Set<Comments> getComment() {
		return comment;
	}
	public void setComment(Set<Comments> comment) {
		this.comment = comment;
	}
	@Id
    @GeneratedValue (strategy=GenerationType.AUTO)
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	
	@Column(unique=true,nullable=false)
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public int getHeadCronID() {
		return headCronID;
	}
	public void setHeadCronID(int headCronID) {
		this.headCronID = headCronID;
	}
	
}
